<template>
  <span>{{ item }}: {{ succed }}</span>
</template>

<script>
export default {
  props: ['item', 'list'],
  data() {
    return {
      succed: ''
    }
  },
  // 监听器  随时监听数据的变化
  watch: {
    list: {
      handler(val) {
        if (this.item === val[0]) {
          // console.log(val);
          this.succed = val[1]
        } else {
          this.succed = '未完成'
        }
      },
      immediate: true
    }
  }
};
</script>

<style scoped>
.right {
  color: green;
}

.error {
  color: red;
}

.undo {
  color: #ccc;
}
</style>